<script lang="ts">
import {Ref, ref} from "vue";

export default {
  name: "App",
  setup() {
    console.log("setup执行了",this)
    const count: Ref<number> = ref<number>(0)
    const handleAdd: () => void = (): void => {
      count.value++
    }
    // 模板中需要使用的数据和方法需要return出去
    return {
      count,
      handleAdd
    }
  },
  beforeCreate() {
    console.log("vue2的beforeCreate执行了",this)
  }
}
</script>

<template>
  <div class="app">

  </div>
</template>

<style scoped>
.app {
  width: 800px;
  height: 300px;
  margin: 0 auto;
}
</style>
